define(['jquery','bootstrap_paginator'], function($,bootstrp) {
	var _setPage = function(curPage,allPage,allNum,callback) {
		$("#pageBox").hide();
		if(curPage==undefined || allPage ==undefined || curPage==0 || allPage==0 || allNum==0){//不显示页数
			$("#pagebox").hide();
		}else{
			var options = {
					currentPage:curPage,//当前页
					totalPages:allPage,//总页数
					numberOfPages:5,//显示页数
					bootstrapMajorVersion:3,
					itemTexts: function(type, page, current){
						switch (type) {
		                case "first":
		                    return "首页";
		                case "prev":
		                    return "上一页";
		                case "next":
		                    return "下一页";
		                case "last":
		                    return "末页";
		                case "page":
		                    return page;
		                }
					},onPageClicked:function (event, originalEvent, type, page){
						callback(page,type,originalEvent,event);
					}
				}
			$("#records").html(allNum);
			$("#page").bootstrapPaginator(options);
			$("#pageBox").show();
		}
	};
	 return{
		 setPage: function(curPage,allPage,allNum,callback) {
			_setPage(curPage,allPage,allNum,callback);
		 }
	 }
});